{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 特征工程与机器学习建模"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 自定义工具函数库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#coding=utf-8\n",
    "import  pandas as pd\n",
    "import numpy as np\n",
    "import scipy as sp\n",
    "\n",
    "\n",
    "#文件读取\n",
    "def read_csv_file(f,logging=False):\n",
    "    print(\"============================读取数据========================\",f)\n",
    "    print(\"======================我是萌萌哒分界线========================\")\n",
    "    data = pd.read_csv(f)\n",
    "    if logging:\n",
    "        print(data.head(5))\n",
    "        print(f,\"  包含以下列....\")\n",
    "        print(data.columns.values)\n",
    "        print(data.describe())\n",
    "        print(data.info())\n",
    "    return  data\n",
    "\n",
    "#第一类编码\n",
    "def categories_process_first_class(cate):\n",
    "    cate = str(cate)\n",
    "    if len(cate)==1:\n",
    "        if int(cate)==0:\n",
    "            return 0\n",
    "    else:\n",
    "        return int(cate[0])\n",
    "\n",
    "#第2类编码\n",
    "def categories_process_second_class(cate):\n",
    "    cate = str(cate)\n",
    "    if len(cate)<3:\n",
    "        return 0\n",
    "    else:\n",
    "        return int(cate[1:])\n",
    "\n",
    "#年龄处理，切段\n",
    "def age_process(age):\n",
    "    age = int(age)\n",
    "    if age==0:\n",
    "        return 0\n",
    "    elif age<15:\n",
    "        return 1\n",
    "    elif age<25:\n",
    "        return 2\n",
    "    elif age<40:\n",
    "        return 3\n",
    "    elif age<60:\n",
    "        return 4\n",
    "    else:\n",
    "        return 5\n",
    "\n",
    "#省份处理\n",
    "def process_province(hometown):\n",
    "    hometown = str(hometown)\n",
    "    province = int(hometown[0:2])\n",
    "    return province\n",
    "\n",
    "#城市处理\n",
    "def process_city(hometown):\n",
    "    hometown = str(hometown)\n",
    "    if len(hometown)>1:\n",
    "        province = int(hometown[2:])\n",
    "    else:\n",
    "        province = 0\n",
    "    return province\n",
    "\n",
    "#几点钟\n",
    "def get_time_day(t):\n",
    "    t = str(t)\n",
    "    t=int(t[0:2])\n",
    "    return t\n",
    "\n",
    "#一天切成4段\n",
    "def get_time_hour(t):\n",
    "    t = str(t)\n",
    "    t=int(t[2:4])\n",
    "    if t<6:\n",
    "        return 0\n",
    "    elif t<12:\n",
    "        return 1\n",
    "    elif t<18:\n",
    "        return 2\n",
    "    else:\n",
    "        return 3\n",
    "\n",
    "#评估与计算logloss\n",
    "def logloss(act, pred):\n",
    "  epsilon = 1e-15\n",
    "  pred = sp.maximum(epsilon, pred)\n",
    "  pred = sp.minimum(1-epsilon, pred)\n",
    "  ll = sum(act*sp.log(pred) + sp.subtract(1,act)*sp.log(sp.subtract(1,pred)))\n",
    "  ll = ll * -1.0/len(act)\n",
    "  return ll"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 特征工程+随机森林建模"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### import 库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#coding=utf-8\n",
    "from sklearn.preprocessing import Binarizer\n",
    "from sklearn.preprocessing import MinMaxScaler\n",
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 读取train_data和ad\n",
    "#### 特征工程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============================读取数据======================== F:\\data\\pre\\train.csv\n======================我是萌萌哒分界线========================\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   label  clickTime  conversionTime  creativeID   userID  positionID  \\\n0      0     170000             NaN        3089  2798058         293   \n1      0     170000             NaN        1259   463234        6161   \n2      0     170000             NaN        4465  1857485        7434   \n3      0     170000             NaN        1004  2038823         977   \n4      0     170000             NaN        1887  2015141        3688   \n\n   connectionType  telecomsOperator  \n0               1                 1  \n1               1                 2  \n2               4                 1  \n3               1                 1  \n4               1                 1  \nF:\\data\\pre\\train.csv   包含以下列....\n['label' 'clickTime' 'conversionTime' 'creativeID' 'userID' 'positionID'\n 'connectionType' 'telecomsOperator']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              label     clickTime  conversionTime    creativeID        userID  \\\ncount  3.749528e+06  3.749528e+06    93262.000000  3.749528e+06  3.749528e+06   \nmean   2.487300e-02  2.418317e+05   242645.358013  3.261575e+03  1.405349e+06   \nstd    1.557380e-01  3.958793e+04    39285.385532  1.829643e+03  8.088094e+05   \nmin    0.000000e+00  1.700000e+05   170005.000000  1.000000e+00  1.000000e+00   \n25%    0.000000e+00  2.116270e+05   211626.000000  1.540000e+03  7.058698e+05   \n50%    0.000000e+00  2.418390e+05   242106.000000  3.465000e+03  1.407062e+06   \n75%    0.000000e+00  2.722170e+05   272344.000000  4.565000e+03  2.105989e+06   \nmax    1.000000e+00  3.023590e+05   302359.000000  6.582000e+03  2.805118e+06   \n\n         positionID  connectionType  telecomsOperator  \ncount  3.749528e+06    3.749528e+06      3.749528e+06  \nmean   3.702799e+03    1.222590e+00      1.605879e+00  \nstd    1.923724e+03    5.744428e-01      8.491127e-01  \nmin    1.000000e+00    0.000000e+00      0.000000e+00  \n25%    2.579000e+03    1.000000e+00      1.000000e+00  \n50%    3.322000e+03    1.000000e+00      1.000000e+00  \n75%    4.896000e+03    1.000000e+00      2.000000e+00  \nmax    7.645000e+03    4.000000e+00      3.000000e+00  \n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 3749528 entries, 0 to 3749527\nData columns (total 8 columns):\nlabel               int64\nclickTime           int64\nconversionTime      float64\ncreativeID          int64\nuserID              int64\npositionID          int64\nconnectionType      int64\ntelecomsOperator    int64\ndtypes: float64(1), int64(7)\nmemory usage: 228.9 MB\nNone\n============================读取数据======================== F:\\data\\pre\\ad.csv\n======================我是萌萌哒分界线========================\n   creativeID  adID  camgaignID  advertiserID  appID  appPlatform\n0        4079  2318         147            80     14            2\n1        4565  3593         632             3    465            1\n2        3170  1593         205            54    389            1\n3        6566  2390         205            54    389            1\n4        5187   411         564             3    465            1\nF:\\data\\pre\\ad.csv   包含以下列....\n['creativeID' 'adID' 'camgaignID' 'advertiserID' 'appID' 'appPlatform']\n        creativeID         adID   camgaignID  advertiserID        appID  \\\ncount  6582.000000  6582.000000  6582.000000   6582.000000  6582.000000   \nmean   3291.500000  1786.341689   313.397144     44.381191   310.805682   \nstd    1900.204068  1045.890729   210.636055     24.091342   125.577377   \nmin       1.000000     1.000000     1.000000      1.000000    14.000000   \n25%    1646.250000   882.250000   131.000000     26.000000   205.000000   \n50%    3291.500000  1771.000000   274.000000     54.000000   389.000000   \n75%    4936.750000  2698.750000   512.000000     57.000000   421.000000   \nmax    6582.000000  3616.000000   720.000000     91.000000   472.000000   \n\n       appPlatform  \ncount  6582.000000  \nmean      1.448952  \nstd       0.497425  \nmin       1.000000  \n25%       1.000000  \n50%       1.000000  \n75%       2.000000  \nmax       2.000000  \n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 6582 entries, 0 to 6581\nData columns (total 6 columns):\ncreativeID      6582 non-null int64\nadID            6582 non-null int64\ncamgaignID      6582 non-null int64\nadvertiserID    6582 non-null int64\nappID           6582 non-null int64\nappPlatform     6582 non-null int64\ndtypes: int64(6)\nmemory usage: 308.6 KB\nNone\n"
     ]
    }
   ],
   "source": [
    "#['label' 'clickTime' 'conversionTime' 'creativeID' 'userID' 'positionID' 'connectionType' 'telecomsOperator']\n",
    "train_data = read_csv_file('F:\\data\\pre\\\\train.csv',logging=True)\n",
    "\n",
    "#['creativeID' 'adID' 'camgaignID' 'advertiserID' 'appID' 'appPlatform']\n",
    "ad = read_csv_file('F:\\data\\pre\\\\ad.csv',logging=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============================读取数据======================== F:\\data\\pre\\app_categories.csv\n======================我是萌萌哒分界线========================\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   appID  appCategory\n0     14            2\n1     25          203\n2     68          104\n3     75          402\n4     83          203\nF:\\data\\pre\\app_categories.csv   包含以下列....\n['appID' 'appCategory']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "               appID    appCategory\ncount  217041.000000  217041.000000\nmean   137220.306472     161.856133\nstd    105340.872671     157.746571\nmin        14.000000       0.000000\n25%     54585.000000       0.000000\n50%    111520.000000     106.000000\n75%    195882.000000     301.000000\nmax    433269.000000     503.000000\n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 217041 entries, 0 to 217040\nData columns (total 2 columns):\nappID          217041 non-null int64\nappCategory    217041 non-null int64\ndtypes: int64(2)\nmemory usage: 3.3 MB\nNone\n"
     ]
    }
   ],
   "source": [
    "#app\n",
    "app_categories = read_csv_file('F:\\data\\pre\\\\app_categories.csv',logging=True)\n",
    "app_categories[\"app_categories_first_class\"] = app_categories['appCategory'].apply(categories_process_first_class)\n",
    "app_categories[\"app_categories_second_class\"] = app_categories['appCategory'].apply(categories_process_second_class)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>appID</th>\n",
       "      <th>appCategory</th>\n",
       "      <th>app_categories_first_class</th>\n",
       "      <th>app_categories_second_class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>25</td>\n",
       "      <td>203</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>68</td>\n",
       "      <td>104</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>75</td>\n",
       "      <td>402</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>83</td>\n",
       "      <td>203</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>appID</th>\n",
       "      <th>appCategory</th>\n",
       "      <th>app_categories_first_class</th>\n",
       "      <th>app_categories_second_class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>14</td>\n",
       "      <td>2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>25</td>\n",
       "      <td>203</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>68</td>\n",
       "      <td>104</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>75</td>\n",
       "      <td>402</td>\n",
       "      <td>4.0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>83</td>\n",
       "      <td>203</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "app_categories.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============================读取数据======================== F:\\data\\pre\\user.csv\n======================我是萌萌哒分界线========================\n"
     ]
    }
   ],
   "source": [
    "user = read_csv_file('F:\\data\\pre\\\\user.csv',logging=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['userID', 'age', 'gender', 'education', 'marriageStatus', 'haveBaby',\n       'hometown', 'residence'],\n      dtype='object')"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>userID</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>education</th>\n",
       "      <th>marriageStatus</th>\n",
       "      <th>haveBaby</th>\n",
       "      <th>hometown</th>\n",
       "      <th>residence</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>42</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>512</td>\n",
       "      <td>503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1403</td>\n",
       "      <td>1403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>21</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>607</td>\n",
       "      <td>607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>22</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>20</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>301</td>\n",
       "      <td>2301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>17</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>313</td>\n",
       "      <td>313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>21</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1607</td>\n",
       "      <td>1607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>38</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2203</td>\n",
       "      <td>2203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>17</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2405</td>\n",
       "      <td>1601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>116</td>\n",
       "      <td>2101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>20</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>604</td>\n",
       "      <td>601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>513</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>510</td>\n",
       "      <td>1802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1403</td>\n",
       "      <td>1403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>22</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>206</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>28</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1011</td>\n",
       "      <td>1106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>47</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>203</td>\n",
       "      <td>1008</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>userID</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>education</th>\n",
       "      <th>marriageStatus</th>\n",
       "      <th>haveBaby</th>\n",
       "      <th>hometown</th>\n",
       "      <th>residence</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>42</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>512</td>\n",
       "      <td>503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1403</td>\n",
       "      <td>1403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>21</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>607</td>\n",
       "      <td>607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>22</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>20</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>301</td>\n",
       "      <td>2301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7</td>\n",
       "      <td>17</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>313</td>\n",
       "      <td>313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8</td>\n",
       "      <td>21</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1607</td>\n",
       "      <td>1607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>9</td>\n",
       "      <td>38</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2203</td>\n",
       "      <td>2203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>11</td>\n",
       "      <td>17</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2405</td>\n",
       "      <td>1601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>12</td>\n",
       "      <td>15</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>116</td>\n",
       "      <td>2101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>13</td>\n",
       "      <td>20</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>604</td>\n",
       "      <td>601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>15</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>513</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>16</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>510</td>\n",
       "      <td>1802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>17</td>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1403</td>\n",
       "      <td>1403</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>18</td>\n",
       "      <td>22</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>206</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>19</td>\n",
       "      <td>28</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1011</td>\n",
       "      <td>1106</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20</td>\n",
       "      <td>47</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>203</td>\n",
       "      <td>1008</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>userID</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>education</th>\n",
       "      <th>marriageStatus</th>\n",
       "      <th>haveBaby</th>\n",
       "      <th>hometown</th>\n",
       "      <th>residence</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.393745e+06</td>\n",
       "      <td>2.277593e+01</td>\n",
       "      <td>1.410284e+00</td>\n",
       "      <td>1.975580e+00</td>\n",
       "      <td>1.017286e+00</td>\n",
       "      <td>3.033893e-01</td>\n",
       "      <td>7.372152e+02</td>\n",
       "      <td>9.797279e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>8.105652e+05</td>\n",
       "      <td>9.675687e+00</td>\n",
       "      <td>5.321244e-01</td>\n",
       "      <td>1.577530e+00</td>\n",
       "      <td>9.508679e-01</td>\n",
       "      <td>8.098684e-01</td>\n",
       "      <td>7.746096e+02</td>\n",
       "      <td>7.855014e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>6.903605e+05</td>\n",
       "      <td>1.500000e+01</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>3.050000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.388503e+06</td>\n",
       "      <td>2.100000e+01</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>5.030000e+02</td>\n",
       "      <td>8.030000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.095096e+06</td>\n",
       "      <td>2.800000e+01</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>3.000000e+00</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.301000e+03</td>\n",
       "      <td>1.513000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.805118e+06</td>\n",
       "      <td>8.000000e+01</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>7.000000e+00</td>\n",
       "      <td>3.000000e+00</td>\n",
       "      <td>6.000000e+00</td>\n",
       "      <td>3.401000e+03</td>\n",
       "      <td>3.401000e+03</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>userID</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>education</th>\n",
       "      <th>marriageStatus</th>\n",
       "      <th>haveBaby</th>\n",
       "      <th>hometown</th>\n",
       "      <th>residence</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "      <td>2.510847e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.393745e+06</td>\n",
       "      <td>2.277593e+01</td>\n",
       "      <td>1.410284e+00</td>\n",
       "      <td>1.975580e+00</td>\n",
       "      <td>1.017286e+00</td>\n",
       "      <td>3.033893e-01</td>\n",
       "      <td>7.372152e+02</td>\n",
       "      <td>9.797279e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>8.105652e+05</td>\n",
       "      <td>9.675687e+00</td>\n",
       "      <td>5.321244e-01</td>\n",
       "      <td>1.577530e+00</td>\n",
       "      <td>9.508679e-01</td>\n",
       "      <td>8.098684e-01</td>\n",
       "      <td>7.746096e+02</td>\n",
       "      <td>7.855014e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>6.903605e+05</td>\n",
       "      <td>1.500000e+01</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>3.050000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.388503e+06</td>\n",
       "      <td>2.100000e+01</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>1.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>5.030000e+02</td>\n",
       "      <td>8.030000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.095096e+06</td>\n",
       "      <td>2.800000e+01</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>3.000000e+00</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>0.000000e+00</td>\n",
       "      <td>1.301000e+03</td>\n",
       "      <td>1.513000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.805118e+06</td>\n",
       "      <td>8.000000e+01</td>\n",
       "      <td>2.000000e+00</td>\n",
       "      <td>7.000000e+00</td>\n",
       "      <td>3.000000e+00</td>\n",
       "      <td>6.000000e+00</td>\n",
       "      <td>3.401000e+03</td>\n",
       "      <td>3.401000e+03</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user[user.age!=0].describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     294271\n15    150175\n16    120322\n17    115704\n19    115692\n13    114651\n20    112301\n18    110549\n14    107356\n25     99378\n21     96306\n26     92987\n22     91733\n12     88838\n23     87728\n27     84934\n28     80358\n24     79479\n11     78679\n29     68688\n30     55187\n31     47475\n33     43033\n32     41638\n10     39061\n34     34062\n35     33106\n36     29333\n37     26512\n38     21280\n       ...  \n6       3924\n5       3395\n54      2193\n55      2111\n4       1959\n56      1795\n57      1771\n58      1527\n59      1362\n60      1100\n61       923\n62       412\n63       292\n66       285\n65       266\n64       234\n67       220\n80       165\n68       145\n69       124\n70       123\n71       104\n78        89\n73        87\n74        86\n76        85\n75        81\n72        77\n77        72\n79        55\nName: age, Length: 81, dtype: int64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "user.age.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============================读取数据======================== F:\\data\\pre\\user.csv\n======================我是萌萌哒分界线========================\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   userID  age  gender  education  marriageStatus  haveBaby  hometown  \\\n0       1   42       1          0               2         0       512   \n1       2   18       1          5               1         0      1403   \n2       3    0       2          4               0         0         0   \n3       4   21       2          5               3         0       607   \n4       5   22       2          0               0         0         0   \n\n   residence  \n0        503  \n1       1403  \n2          0  \n3        607  \n4       1301  \nF:\\data\\pre\\user.csv   包含以下列....\n['userID' 'age' 'gender' 'education' 'marriageStatus' 'haveBaby' 'hometown'\n 'residence']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "             userID           age        gender     education  marriageStatus  \\\ncount  2.805118e+06  2.805118e+06  2.805118e+06  2.805118e+06    2.805118e+06   \nmean   1.402560e+06  2.038662e+01  1.294072e+00  1.889235e+00    9.870540e-01   \nstd    8.097680e+05  1.151120e+01  6.409864e-01  1.607085e+00    9.621890e-01   \nmin    1.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00    0.000000e+00   \n25%    7.012802e+05  1.400000e+01  1.000000e+00  1.000000e+00    0.000000e+00   \n50%    1.402560e+06  2.000000e+01  1.000000e+00  2.000000e+00    1.000000e+00   \n75%    2.103839e+06  2.700000e+01  2.000000e+00  3.000000e+00    2.000000e+00   \nmax    2.805118e+06  8.000000e+01  2.000000e+00  7.000000e+00    3.000000e+00   \n\n           haveBaby      hometown     residence  \ncount  2.805118e+06  2.805118e+06  2.805118e+06  \nmean   2.848418e-01  6.750372e+02  9.571084e+02  \nstd    7.800834e-01  7.691699e+02  7.897154e+02  \nmin    0.000000e+00  0.000000e+00  0.000000e+00  \n25%    0.000000e+00  0.000000e+00  3.020000e+02  \n50%    0.000000e+00  4.030000e+02  7.170000e+02  \n75%    0.000000e+00  1.201000e+03  1.507000e+03  \nmax    6.000000e+00  3.401000e+03  3.401000e+03  \n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 2805118 entries, 0 to 2805117\nData columns (total 8 columns):\nuserID            int64\nage               int64\ngender            int64\neducation         int64\nmarriageStatus    int64\nhaveBaby          int64\nhometown          int64\nresidence         int64\ndtypes: int64(8)\nmemory usage: 171.2 MB\nNone\n"
     ]
    }
   ],
   "source": [
    "#user\n",
    "user = read_csv_file('F:\\data\\pre\\\\user.csv',logging=True)\n",
    "user['age_process'] = user['age'].apply(age_process)\n",
    "user[\"hometown_province\"] = user['hometown'].apply(process_province)\n",
    "user[\"hometown_city\"] = user['hometown'].apply(process_city)\n",
    "user[\"residence_province\"] = user['residence'].apply(process_province)\n",
    "user[\"residence_city\"] = user['residence'].apply(process_city)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 2805118 entries, 0 to 2805117\nData columns (total 13 columns):\nuserID                int64\nage                   int64\ngender                int64\neducation             int64\nmarriageStatus        int64\nhaveBaby              int64\nhometown              int64\nresidence             int64\nage_process           int64\nhometown_province     int64\nhometown_city         int64\nresidence_province    int64\nresidence_city        int64\ndtypes: int64(13)\nmemory usage: 278.2 MB\n"
     ]
    }
   ],
   "source": [
    "user.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>userID</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>education</th>\n",
       "      <th>marriageStatus</th>\n",
       "      <th>haveBaby</th>\n",
       "      <th>hometown</th>\n",
       "      <th>residence</th>\n",
       "      <th>age_process</th>\n",
       "      <th>hometown_province</th>\n",
       "      <th>hometown_city</th>\n",
       "      <th>residence_province</th>\n",
       "      <th>residence_city</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>42</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>512</td>\n",
       "      <td>503</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>2</td>\n",
       "      <td>50</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1403</td>\n",
       "      <td>1403</td>\n",
       "      <td>2</td>\n",
       "      <td>14</td>\n",
       "      <td>3</td>\n",
       "      <td>14</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>21</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>607</td>\n",
       "      <td>607</td>\n",
       "      <td>2</td>\n",
       "      <td>60</td>\n",
       "      <td>7</td>\n",
       "      <td>60</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>22</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1301</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>userID</th>\n",
       "      <th>age</th>\n",
       "      <th>gender</th>\n",
       "      <th>education</th>\n",
       "      <th>marriageStatus</th>\n",
       "      <th>haveBaby</th>\n",
       "      <th>hometown</th>\n",
       "      <th>residence</th>\n",
       "      <th>age_process</th>\n",
       "      <th>hometown_province</th>\n",
       "      <th>hometown_city</th>\n",
       "      <th>residence_province</th>\n",
       "      <th>residence_city</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>42</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>512</td>\n",
       "      <td>503</td>\n",
       "      <td>4</td>\n",
       "      <td>51</td>\n",
       "      <td>2</td>\n",
       "      <td>50</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1403</td>\n",
       "      <td>1403</td>\n",
       "      <td>2</td>\n",
       "      <td>14</td>\n",
       "      <td>3</td>\n",
       "      <td>14</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>21</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>607</td>\n",
       "      <td>607</td>\n",
       "      <td>2</td>\n",
       "      <td>60</td>\n",
       "      <td>7</td>\n",
       "      <td>60</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>22</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1301</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>label</th>\n",
       "      <th>clickTime</th>\n",
       "      <th>conversionTime</th>\n",
       "      <th>creativeID</th>\n",
       "      <th>userID</th>\n",
       "      <th>positionID</th>\n",
       "      <th>connectionType</th>\n",
       "      <th>telecomsOperator</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>2798058</td>\n",
       "      <td>293</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1259</td>\n",
       "      <td>463234</td>\n",
       "      <td>6161</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4465</td>\n",
       "      <td>1857485</td>\n",
       "      <td>7434</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1004</td>\n",
       "      <td>2038823</td>\n",
       "      <td>977</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1887</td>\n",
       "      <td>2015141</td>\n",
       "      <td>3688</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>label</th>\n",
       "      <th>clickTime</th>\n",
       "      <th>conversionTime</th>\n",
       "      <th>creativeID</th>\n",
       "      <th>userID</th>\n",
       "      <th>positionID</th>\n",
       "      <th>connectionType</th>\n",
       "      <th>telecomsOperator</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>2798058</td>\n",
       "      <td>293</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1259</td>\n",
       "      <td>463234</td>\n",
       "      <td>6161</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4465</td>\n",
       "      <td>1857485</td>\n",
       "      <td>7434</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1004</td>\n",
       "      <td>2038823</td>\n",
       "      <td>977</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1887</td>\n",
       "      <td>2015141</td>\n",
       "      <td>3688</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train_data['clickTime_day'] = train_data['clickTime'].apply(get_time_day)\n",
    "train_data['clickTime_hour']= train_data['clickTime'].apply(get_time_hour)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 合并数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "============================读取数据======================== F:\\data\\pre\\test.csv\n======================我是萌萌哒分界线========================\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   instanceID  label  clickTime  creativeID   userID  positionID  \\\n0           1     -1     310000        3745  1164848        3451   \n1           2     -1     310000        2284  2127247        1613   \n2           3     -1     310000        1456  2769125        5510   \n3           4     -1     310000        4565     9762        4113   \n4           5     -1     310000          49  2513636        3615   \n\n   connectionType  telecomsOperator  \n0               1                 3  \n1               1                 3  \n2               2                 1  \n3               2                 3  \n4               1                 3  \nF:\\data\\pre\\test.csv   包含以下列....\n['instanceID' 'label' 'clickTime' 'creativeID' 'userID' 'positionID'\n 'connectionType' 'telecomsOperator']\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "          instanceID     label      clickTime     creativeID        userID  \\\ncount  338489.000000  338489.0  338489.000000  338489.000000  3.384890e+05   \nmean   169245.000000      -1.0  311479.490613    3001.534765  1.409519e+06   \nstd     97713.501971       0.0     580.393521    1869.336873  8.073083e+05   \nmin         1.000000      -1.0  310000.000000       4.000000  3.000000e+00   \n25%     84623.000000      -1.0  311053.000000    1248.000000  7.149930e+05   \n50%    169245.000000      -1.0  311536.000000    3012.000000  1.411134e+06   \n75%    253867.000000      -1.0  311951.000000    4565.000000  2.108981e+06   \nmax    338489.000000      -1.0  312359.000000    6580.000000  2.805117e+06   \n\n          positionID  connectionType  telecomsOperator  \ncount  338489.000000   338489.000000     338489.000000  \nmean     3640.126394        1.139015          1.629028  \nstd      1902.559504        0.511882          0.854993  \nmin         2.000000        0.000000          0.000000  \n25%      2436.000000        1.000000          1.000000  \n50%      3322.000000        1.000000          1.000000  \n75%      4881.000000        1.000000          2.000000  \nmax      7645.000000        4.000000          3.000000  \n<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 338489 entries, 0 to 338488\nData columns (total 8 columns):\ninstanceID          338489 non-null int64\nlabel               338489 non-null int64\nclickTime           338489 non-null int64\ncreativeID          338489 non-null int64\nuserID              338489 non-null int64\npositionID          338489 non-null int64\nconnectionType      338489 non-null int64\ntelecomsOperator    338489 non-null int64\ndtypes: int64(8)\nmemory usage: 20.7 MB\nNone\n"
     ]
    }
   ],
   "source": [
    "#train data\n",
    "train_data['clickTime_day'] = train_data['clickTime'].apply(get_time_day)\n",
    "train_data['clickTime_hour']= train_data['clickTime'].apply(get_time_hour)\n",
    "# train_data['conversionTime_day'] = train_data['conversionTime'].apply(get_time_day)\n",
    "# train_data['conversionTime_hour'] = train_data['conversionTime'].apply(get_time_hour)\n",
    "\n",
    "\n",
    "#test_data\n",
    "test_data = read_csv_file('F:\\data\\pre\\\\test.csv', True)\n",
    "test_data['clickTime_day'] = test_data['clickTime'].apply(get_time_day)\n",
    "test_data['clickTime_hour']= test_data['clickTime'].apply(get_time_hour)\n",
    "# test_data['conversionTime_day'] = test_data['conversionTime'].apply(get_time_day)\n",
    "# test_data['conversionTime_hour'] = test_data['conversionTime'].apply(get_time_hour)\n",
    "\n",
    "\n",
    "train_user = pd.merge(train_data,user,on='userID')\n",
    "train_user_ad = pd.merge(train_user,ad,on='creativeID')\n",
    "train_user_ad_app = pd.merge(train_user_ad,app_categories,on='appID')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>label</th>\n",
       "      <th>clickTime</th>\n",
       "      <th>conversionTime</th>\n",
       "      <th>creativeID</th>\n",
       "      <th>userID</th>\n",
       "      <th>positionID</th>\n",
       "      <th>connectionType</th>\n",
       "      <th>telecomsOperator</th>\n",
       "      <th>clickTime_day</th>\n",
       "      <th>clickTime_hour</th>\n",
       "      <th>...</th>\n",
       "      <th>residence_province</th>\n",
       "      <th>residence_city</th>\n",
       "      <th>adID</th>\n",
       "      <th>camgaignID</th>\n",
       "      <th>advertiserID</th>\n",
       "      <th>appID</th>\n",
       "      <th>appPlatform</th>\n",
       "      <th>appCategory</th>\n",
       "      <th>app_categories_first_class</th>\n",
       "      <th>app_categories_second_class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>2798058</td>\n",
       "      <td>293</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>170001</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>195578</td>\n",
       "      <td>3659</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>170014</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>1462213</td>\n",
       "      <td>3659</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>170030</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>1985880</td>\n",
       "      <td>5581</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>170047</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>2152167</td>\n",
       "      <td>5581</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>3</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>label</th>\n",
       "      <th>clickTime</th>\n",
       "      <th>conversionTime</th>\n",
       "      <th>creativeID</th>\n",
       "      <th>userID</th>\n",
       "      <th>positionID</th>\n",
       "      <th>connectionType</th>\n",
       "      <th>telecomsOperator</th>\n",
       "      <th>clickTime_day</th>\n",
       "      <th>clickTime_hour</th>\n",
       "      <th>...</th>\n",
       "      <th>residence_province</th>\n",
       "      <th>residence_city</th>\n",
       "      <th>adID</th>\n",
       "      <th>camgaignID</th>\n",
       "      <th>advertiserID</th>\n",
       "      <th>appID</th>\n",
       "      <th>appPlatform</th>\n",
       "      <th>appCategory</th>\n",
       "      <th>app_categories_first_class</th>\n",
       "      <th>app_categories_second_class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>170000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>2798058</td>\n",
       "      <td>293</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>170001</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>195578</td>\n",
       "      <td>3659</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>170014</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>1462213</td>\n",
       "      <td>3659</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>170030</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>1985880</td>\n",
       "      <td>5581</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>170047</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3089</td>\n",
       "      <td>2152167</td>\n",
       "      <td>5581</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>3</td>\n",
       "      <td>1321</td>\n",
       "      <td>83</td>\n",
       "      <td>10</td>\n",
       "      <td>434</td>\n",
       "      <td>1</td>\n",
       "      <td>108</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_user_ad_app.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['label', 'clickTime', 'conversionTime', 'creativeID', 'userID',\n       'positionID', 'connectionType', 'telecomsOperator', 'clickTime_day',\n       'clickTime_hour', 'age', 'gender', 'education', 'marriageStatus',\n       'haveBaby', 'hometown', 'residence', 'age_process', 'hometown_province',\n       'hometown_city', 'residence_province', 'residence_city', 'adID',\n       'camgaignID', 'advertiserID', 'appID', 'appPlatform', 'appCategory',\n       'app_categories_first_class', 'app_categories_second_class'],\n      dtype='object')"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_user_ad_app.columns"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 取出数据和label"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#特征部分\n",
    "x_user_ad_app = train_user_ad_app.loc[:,['creativeID','userID','positionID',\n",
    " 'connectionType','telecomsOperator','clickTime_day','clickTime_hour','age', 'gender' ,'education',\n",
    " 'marriageStatus' ,'haveBaby' , 'residence' ,'age_process',\n",
    " 'hometown_province', 'hometown_city','residence_province', 'residence_city',\n",
    " 'adID', 'camgaignID', 'advertiserID', 'appID' ,'appPlatform' ,\n",
    " 'app_categories_first_class' ,'app_categories_second_class']]\n",
    "\n",
    "x_user_ad_app = x_user_ad_app.values\n",
    "x_user_ad_app = np.array(x_user_ad_app,dtype='int32')\n",
    "\n",
    "#标签部分\n",
    "y_user_ad_app =train_user_ad_app.loc[:,['label']].values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 随机森林建模&&特征重要度排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "# %matplotlib inline\n",
    "# import matplotlib.pyplot as plt\n",
    "# print('Plot feature importances...')\n",
    "# ax = lgb.plot_importance(gbm, max_num_features=10)\n",
    "# plt.show()\n",
    "# 用RF 计算特征重要度\n",
    "\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "from sklearn.model_selection import cross_val_score, train_test_split\n",
    "\n",
    "feat_labels = np.array(['creativeID','userID','positionID',\n",
    " 'connectionType','telecomsOperator','clickTime_day','clickTime_hour','age', 'gender' ,'education',\n",
    " 'marriageStatus' ,'haveBaby' , 'residence' ,'age_process',\n",
    " 'hometown_province', 'hometown_city','residence_province', 'residence_city',\n",
    " 'adID', 'camgaignID', 'advertiserID', 'appID' ,'appPlatform' ,\n",
    " 'app_categories_first_class' ,'app_categories_second_class'])\n",
    "\n",
    "forest = RandomForestClassifier(n_estimators=100,\n",
    "                                random_state=0,\n",
    "                                n_jobs=-1)\n",
    "\n",
    "forest.fit(x_user_ad_app, y_user_ad_app.reshape(y_user_ad_app.shape[0],))\n",
    "importances = forest.feature_importances_\n",
    "\n",
    "indices = np.argsort(importances)[::-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3749528, 30)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_user_ad_app.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.02791289,  0.16602297,  0.06583927,  0.00427082,  0.03330029,\n",
       "        0.0773544 ,  0.03919645,  0.07549754,  0.01282422,  0.04891296,\n",
       "        0.03127753,  0.01864926,  0.09910738,  0.01570717,  0.05421798,\n",
       "        0.04832801,  0.06373888,  0.05784857,  0.01900962,  0.01561504,\n",
       "        0.00836031,  0.00592996,  0.00088301,  0.00322788,  0.00696759])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "importances"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "['creativeID','userID','positionID',\n",
    " 'connectionType','telecomsOperator','clickTime_day','clickTime_hour','age', 'gender' ,'education',\n",
    " 'marriageStatus' ,'haveBaby' , 'residence' ,'age_process',\n",
    " 'hometown_province', 'hometown_city','residence_province', 'residence_city',\n",
    " 'adID', 'camgaignID', 'advertiserID', 'appID' ,'appPlatform' ,\n",
    " 'app_categories_first_class' ,'app_categories_second_class']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 1) userID                         0.166023\n",
      " 2) residence                      0.099107\n",
      " 3) clickTime_day                  0.077354\n",
      " 4) age                            0.075498\n",
      " 5) positionID                     0.065839\n",
      " 6) residence_province             0.063739\n",
      " 7) residence_city                 0.057849\n",
      " 8) hometown_province              0.054218\n",
      " 9) education                      0.048913\n",
      "10) hometown_city                  0.048328\n",
      "11) clickTime_hour                 0.039196\n",
      "12) telecomsOperator               0.033300\n",
      "13) marriageStatus                 0.031278\n",
      "14) creativeID                     0.027913\n",
      "15) adID                           0.019010\n",
      "16) haveBaby                       0.018649\n",
      "17) age_process                    0.015707\n",
      "18) camgaignID                     0.015615\n",
      "19) gender                         0.012824\n",
      "20) advertiserID                   0.008360\n",
      "21) app_categories_second_class    0.006968\n",
      "22) appID                          0.005930\n",
      "23) connectionType                 0.004271\n",
      "24) app_categories_first_class     0.003228\n",
      "25) appPlatform                    0.000883\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAAN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1BL2oACgjCY6llrCgAKAMproWGoJt/gAoIwmOpZawkMSAFDYkDuWWsKAAgAMEntQAIBBYkAB\nAAaJAQUAGCQGFABgkH4B015Bo9ibphMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f158b712a90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "for f in range(x_user_ad_app.shape[1]):\n",
    "    print(\"%2d) %-*s %f\" % (f + 1, 30, \n",
    "                            feat_labels[indices[f]], \n",
    "                            importances[indices[f]]))\n",
    "\n",
    "plt.title('Feature Importances')\n",
    "plt.bar(range(x_user_ad_app.shape[1]), \n",
    "        importances[indices],\n",
    "        color='lightblue', \n",
    "        align='center')\n",
    "\n",
    "plt.xticks(range(x_user_ad_app.shape[1]), \n",
    "           feat_labels[indices], rotation=90)\n",
    "plt.xlim([-1, x_user_ad_app.shape[1]])\n",
    "plt.tight_layout()\n",
    "#plt.savefig('./random_forest.png', dpi=300)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 随机森林调参"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.ensemble import RandomForestClassifier\n",
    "param_grid = {\n",
    "              #'n_estimators': [100],\n",
    "              'n_estimators': [10, 100, 500, 1000],\n",
    "              'max_features':[0.6, 0.7, 0.8, 0.9],\n",
    "          \n",
    "             }\n",
    "\n",
    "rf = RandomForestClassifier()\n",
    "rfc = GridSearchCV(rf, param_grid, scoring = 'neg_log_loss', cv=3, n_jobs=2)\n",
    "rfc.fit(x_user_ad_app, y_user_ad_app.reshape(y_user_ad_app.shape[0],))\n",
    "print(rfc.best_score_)\n",
    "print(rfc.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Xgboost调参"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "No module named 'xgboost'",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-38-745aa3a2d734>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mxgboost\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mxgb\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m: No module named 'xgboost'"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "import xgboost as xgb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "No module named 'xgboost'",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-39-eb0ce4b02126>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mnumpy\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0msklearn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmodel_selection\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mGridSearchCV\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mxgboost\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mxgb\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      5\u001b[0m \u001b[0mos\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0menviron\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"OMP_NUM_THREADS\"\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m\"8\"\u001b[0m  \u001b[1;31m#并行训练\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m \u001b[0mrng\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mRandomState\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m4315\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mImportError\u001b[0m: No module named 'xgboost'"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "import os\n",
    "import numpy as np\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "import xgboost as xgb\n",
    "os.environ[\"OMP_NUM_THREADS\"] = \"8\"  #并行训练\n",
    "rng = np.random.RandomState(4315)\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "\n",
    "param_grid = {\n",
    "              'max_depth': [3, 4, 5, 7, 9],\n",
    "              'n_estimators': [10, 50, 100, 400, 800, 1000, 1200],\n",
    "              'learning_rate': [0.1, 0.2, 0.3],\n",
    "              'gamma':[0, 0.2],\n",
    "              'subsample': [0.8, 1],\n",
    "              'colsample_bylevel':[0.8, 1]\n",
    "             }\n",
    "\n",
    "xgb_model = xgb.XGBClassifier()\n",
    "rgs = GridSearchCV(xgb_model, param_grid, n_jobs=-1)\n",
    "rgs.fit(X, y)\n",
    "print(rgs.best_score_)\n",
    "print(rgs.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 正负样本比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "39.20424181338595"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "positive_num = train_user_ad_app[train_user_ad_app['label']==1].values.shape[0]\n",
    "negative_num = train_user_ad_app[train_user_ad_app['label']==0].values.shape[0]\n",
    "\n",
    "negative_num/float(positive_num)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**我们可以看到正负样本数量相差非常大，数据严重unbalanced**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们用Bagging修正过后，处理不均衡样本的B(l)agging来进行训练和实验。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "No module named 'blagging'",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-41-9dba3942d720>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mblagging\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mBlaggingClassifier\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mImportError\u001b[0m: No module named 'blagging'"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "from blagging import BlaggingClassifier"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'BlaggingClassifier' is not defined",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-42-9753ea823f0b>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mhelp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mBlaggingClassifier\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'BlaggingClassifier' is not defined"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "help(BlaggingClassifier)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#处理unbalanced的classifier\n",
    "classifier = BlaggingClassifier(n_jobs=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py:526: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().\n",
      "  y = column_or_1d(y, warn=True)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "BlaggingClassifier(base_estimator=None, bootstrap=True,\n",
       "          bootstrap_features=False, max_features=1.0, max_samples=1.0,\n",
       "          n_estimators=10, n_jobs=1, oob_score=False, random_state=None,\n",
       "          verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classifier.fit(x_user_ad_app, y_user_ad_app)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "classifier.predict_proba(x_test_clean)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 预测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "test_data = pd.merge(test_data,user,on='userID')\n",
    "test_user_ad = pd.merge(test_data,ad,on='creativeID')\n",
    "test_user_ad_app = pd.merge(test_user_ad,app_categories,on='appID')\n",
    "\n",
    "x_test_clean = test_user_ad_app.loc[:,['creativeID','userID','positionID',\n",
    " 'connectionType','telecomsOperator','clickTime_day','clickTime_hour','age', 'gender' ,'education',\n",
    " 'marriageStatus' ,'haveBaby' , 'residence' ,'age_process',\n",
    " 'hometown_province', 'hometown_city','residence_province', 'residence_city',\n",
    " 'adID', 'camgaignID', 'advertiserID', 'appID' ,'appPlatform' ,\n",
    " 'app_categories_first_class' ,'app_categories_second_class']].values\n",
    "\n",
    "x_test_clean = np.array(x_test_clean,dtype='int32')\n",
    "\n",
    "result_predict_prob = []\n",
    "result_predict=[]\n",
    "for i in range(scale):\n",
    "    result_indiv = clfs[i].predict(x_test_clean)\n",
    "    result_indiv_proba = clfs[i].predict_proba(x_test_clean)[:,1]\n",
    "    result_predict.append(result_indiv)\n",
    "    result_predict_prob.append(result_indiv_proba)\n",
    "\n",
    "\n",
    "result_predict_prob = np.reshape(result_predict_prob,[-1,scale])\n",
    "result_predict = np.reshape(result_predict,[-1,scale])\n",
    "\n",
    "result_predict_prob = np.mean(result_predict_prob,axis=1)\n",
    "result_predict = max_count(result_predict)\n",
    "\n",
    "\n",
    "result_predict_prob = np.array(result_predict_prob).reshape([-1,1])\n",
    "\n",
    "\n",
    "test_data['prob'] = result_predict_prob\n",
    "test_data = test_data.loc[:,['instanceID','prob']]\n",
    "test_data.to_csv('predict.csv',index=False)\n",
    "print \"prediction done!\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
